#!/bin/bash
# Program:
#  This program shows
# History:
# 2017-05-18 zmqc First release
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH

OLDIFS=$IFS
IFS=$'\n'
wlp9s0=`ip a show wlp9s0|awk '/ether|inet/{print $2}'`
mylspci=`lspci |awk -F': ' '/(VGA|Eth|Net)/{print $2}'`
i=0
for var in $wlp9s0
do
    myips[$i]="${var}"
    i=$[$i + 1]
done

myIntel=`echo "${mylspci}"|grep -i 'intel'`
myAmd=`echo "${mylspci}"|grep -i 'amd'`
myEth=`echo "${mylspci}"|grep -i 'eth'`
myWifi=`echo "${mylspci}"|grep -i 'wifi'`

IFS=$OLDIFS

echo "Product    Name:"     `cat /sys/class/dmi/id/board_vendor`    \
     `cat /sys/class/dmi/id/product_version`                        \
     `cat /sys/class/dmi/id/product_name `
echo "Bios       Info:"     `cat /sys/class/dmi/id/bios_vendor `    \
     `cat /sys/class/dmi/id/bios_version `                          \
     `cat /sys/class/dmi/id/bios_date `
echo "             OS:"     `hostnamectl |awk -F ': ' '/System/{print $2}'`
echo "         Kernel:"     `uname -r`
echo "          Shell:"     "Bash" ${BASH_VERSION%(*}
echo "             DE:"     $XDG_CURRENT_DESKTOP
echo "            CPU:"     `cat /proc/cpuinfo |awk -F': '  '/model name/{print $2; exit}'`
echo "            GPU:"     $myIntel
echo "            GPU:"     $myAmd
echo "            Eth:"     $myEth
echo "           Wifi:"     $myWifi
echo "           Time:"     `date`
echo "         Uptime:"     `uptime --pretty`
echo "           IPV4:"     ${myips[1]}
echo "           IPV6:"     ${myips[2]}
echo "            MAC:"     ${myips[0]}
echo "            RAM:"     `free -h | awk '/Mem/{print $3 "/" $2}'`
echo "           SWAP:"     `free -h | awk '/Swap/{print $3 "/" $2}'`
